<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="csrf-token" content="{{ csrf_token() }}">
		<title>交易所</title>
		<link rel="stylesheet" type="text/css" href="css/base.css" />
		<link rel="stylesheet" type="text/css" href="css/mui.min.css" />
		<link rel="stylesheet" type="text/css" href="css/public.css" />
		<link rel="stylesheet" type="text/css" href="css/exchange.css" />
		<script src="js/flexible.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/mui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/gVerify.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/jquery-3.1.1.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<div class="content">
			<h4>选择交易所</h4>
			<select name="ex" id="ex">
				<option value="">选择交易所</option>
				@foreach($ex as $v)
					<option value="{{ $v->ex_id }}">{{ $v->name }}</option>
				@endforeach
			</select>
			<ul class="exchange flexStart">
			</ul>
			<button class="openRecord">查看平台交易记录</button>
		</div>
		<div class="navBottom flexStart">
			<a class="navBottomA" href="exchange.html">交易记录</a>
			<a class="navBottomB" href="my">我的</a>
		</div>
		<script type="text/javascript">
            $.ajaxSetup({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                }
            });
			$('.exchange').on("tap",'li', function() {
				var _index = $(this).index();
				$('.openRecord').attr('content',$(this).text());
				$(this).addClass('exchangeChecked').siblings().removeClass("exchangeChecked");
			});
			//查看交易记录
			$('.openRecord').on("tap", function() {
				var content = $('.openRecord').attr('content');
				var ex=$('#ex').val();
				location.href = "orderLog/"+ex+'/'+content;
			});
			$('#ex').change(function(){
				var ex=$('#ex').val();
				$.post('selCurr',{ex:ex},function(e){
				    var html='';
				    $.each(e.data,function(k,v){
						html+='<li class="exchangeBorder">'+v+'</li>'
					});
					$('.exchange').html(html);
				})
			});
		</script>
	</body>

</html>